package com.wulin.library.service;

import com.wulin.library.entity.User;
import com.wulin.library.repository.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {

    @Autowired
    private UserMapper userMapper;

    public List<User> getAllUser(){
        return userMapper.getAllUser();
    }

    public User getUserById(Integer userId){
        return userMapper.getUserById(userId);
    }

    public void insertUser(User user){
        userMapper.insertUser(user);
    }

    public void updateUser(User user){
        userMapper.updateUser(user);
    }

    public void deleteUser(Integer userId){
        userMapper.deleteUser(userId);
    }

}
